<template>
  <div class="bottom-container">
    <div class="footer-content">
      <div class="footer-logo">新闻网站</div>
      
      <div class="footer-links">
        <div class="link-group">
          <h4>栏目导航</h4>
          <ul>
            <li><a href="#" @click.prevent="setActive('domestic')">国内新闻</a></li>
            <li><a href="#" @click.prevent="setActive('entertainment')">娱乐新闻</a></li>
            <li><a href="#" @click.prevent="setActive('sport')">体育新闻</a></li>
          </ul>
        </div>
        
        <div class="link-group">
          <h4>关于我们</h4>
          <ul>
            <li><a href="#">网站简介</a></li>
            <li><a href="#">联系方式</a></li>
            <li><a href="#">招聘信息</a></li>
          </ul>
        </div>
        
        <div class="link-group">
          <h4>法律信息</h4>
          <ul>
            <li><a href="#">用户协议</a></li>
            <li><a href="#">隐私政策</a></li>
            <li><a href="#">版权声明</a></li>
          </ul>
        </div>
      </div>
      
      <div class="copyright">
        <p>© 2024 新闻网站 版权所有 | 备案号：XXX-XXXXXXX</p>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { inject } from 'vue';

// 接收从父组件传递的activeCategory更新函数
const setActive = inject<(category: string) => void>('setActive');
</script>

<style scoped>
.bottom-container {
  background-color: #2c3e50;
  color: #fff;
  padding: 30px 20px;
  margin-top: 30px;
  border-radius: 0 0 4px 4px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-logo {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-bottom: 20px;
}

.link-group h4 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: #ddd;
}

.link-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-group ul li {
  margin-bottom: 8px;
}

.link-group ul li a {
  color: #aaa;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.link-group ul li a:hover {
  color: #fff;
}

.copyright {
  text-align: center;
  padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  color: #aaa;
}

@media (max-width: 768px) {
  .footer-links {
    flex-direction: column;
    gap: 20px;
  }
}
</style>
    